/*    */ package net.sourceforge.appgen.support;
/*    */ 
/*    */ import net.sourceforge.appgen.model.Entity;
/*    */ import org.eclipse.jface.viewers.CellEditor;
/*    */ import org.eclipse.jface.viewers.CheckboxCellEditor;
/*    */ import org.eclipse.jface.viewers.ColumnViewer;
/*    */ import org.eclipse.jface.viewers.EditingSupport;
/*    */ import org.eclipse.jface.viewers.TableViewer;
/*    */ 
/*    */ public class EntityGeneratorEditingSupport extends EditingSupport
/*    */ {
/*    */   private CellEditor editor;
/*    */ 
/*    */   public EntityGeneratorEditingSupport(ColumnViewer viewer)
/*    */   {
/* 35 */     super(viewer);
/*    */ 
/* 37 */     this.editor = new CheckboxCellEditor(((TableViewer)viewer).getTable());
/*    */   }
/*    */ 
/*    */   protected boolean canEdit(Object element)
/*    */   {
/* 42 */     return true;
/*    */   }
/*    */ 
/*    */   protected CellEditor getCellEditor(Object element)
/*    */   {
/* 47 */     return this.editor;
/*    */   }
/*    */ 
/*    */   protected Object getValue(Object element)
/*    */   {
/* 52 */     Entity entity = (Entity)element;
/*    */ 
/* 54 */     return Boolean.valueOf(entity.isCreate());
/*    */   }
/*    */ 
/*    */   protected void setValue(Object element, Object value)
/*    */   {
/* 59 */     Entity entity = (Entity)element;
/*    */ 
/* 61 */     entity.setCreate(((Boolean)value).booleanValue());
/*    */ 
/* 63 */     getViewer().update(element, null);
/*    */   }
/*    */ }

/* Location:           C:\Users\lzl6066\Downloads\net.sourceforge.appgen_1.2.0\plugins\net.sourceforge.appgen_1.2.0.201002031718\
 * Qualified Name:     net.sourceforge.appgen.support.EntityGeneratorEditingSupport
 * JD-Core Version:    0.6.0
 */